package com.LocalDateTimeStudy;

import freemarker.template.SimpleDate;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

public class MyLocalDateTimeMain {
	public static void main(String[] args) {
//		LocalDateTime now = LocalDateTime.now();

		LocalDate today = LocalDate.now();
		Instant todayInstant = today.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant();
		System.out.println(Date.from(todayInstant));
		LocalDate tomorrow = today.plusDays(1);
		Instant tomorrowInstant = tomorrow.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant();
		System.out.println(Date.from(tomorrowInstant));

		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
		System.out.println(Integer.parseInt(simpleDateFormat.format(Date.from(todayInstant))));
		System.out.println(Integer.parseInt(simpleDateFormat.format(Date.from(tomorrowInstant))));
	}

}
